package com.zihao;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Base64;
import android.view.WindowManager;
import android.widget.TextView;
import java.io.ByteArrayInputStream;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import org.apache.commons.io.FileUtils;
import java.io.IOException;
import org.apache.commons.cli.Util;
public class LogoActivity extends Activity {
	public static String path = Environment.getExternalStorageDirectory ( ).getPath ( );
    @Override
	public void onCreate(Bundle icicle) {
	super.onCreate(icicle);
        getWindow().setFormat(PixelFormat.RGBA_8888);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
        setContentView(R.layout.logo);
		//Display the current version number
        PackageManager pm = getPackageManager();
try {
            PackageInfo pi = pm.getPackageInfo("com.zihao", 0);
            TextView versionNumber = (TextView) findViewById(R.id.versionNumber);
            versionNumber.setText("Version "+ pi.versionName);
        } catch (NameNotFoundException e) {
            e.printStackTrace();
        }
			TextView about = (TextView) findViewById(R.id.about);
			about.setText("Copyright © 2016 KING-子豪 All Rights Resersed");
			new Handler().postDelayed(new Runnable() {
			public void run() {
/* Create an Intent that will start the Main WordPress Activity. */
                Intent mainIntent =new Intent(LogoActivity.this, MainActivity.class);
                LogoActivity.this.startActivity(mainIntent);
                LogoActivity.this.finish();
            }
        }, 2900); //2900 for release
		}
    }

